home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / Mous / TN.MOUS.001 next >
Encoding:
Text File  |  1988-12-15  |  2.6 KB  |  52 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6.  
  7. Mouse
  8. #1:    Interrupt Environment with the Mouse
  9.  
  10. Revised by:    Matt Deatherage                                  November 1988
  11. Revised by:    Rilla Reynolds                                   November 1985
  12.  
  13. This Technical Note describes the interrupt environment one should take into 
  14. account when programming mouse-based applications on the Apple II family of 
  15. computers.
  16. _____________________________________________________________________________
  17.  
  18. Software developers who are writing mouse-based programs in assembly language 
  19. need to be concerned about the computer's interrupt environment, even if they 
  20. are using the mouse in passive mode.  Listed below are several conditions 
  21. which assembly language programmers should take into account if their programs 
  22. are to run on the Apple II family of computers.
  23.  
  24. o    Do not disable interrupts unless absolutely necessary.  If you 
  25.      disable them, be sure to re-enable them.
  26. o    Disable interrupts when calling any mouse routine.  Always use PHP 
  27.      and SEI to disable interrupts, then use PLP to re-enable them.  
  28.      This method preserves the state of interrupts (enabled or 
  29.      disabled).
  30. o    Do not re-enable interrupts (PLP) after a call to ReadMouse until 
  31.      X and Y data have been removed from the screen holes.
  32. o    Disable interrupts (PHP and SEI) before placing position 
  33.      information in the screen holes (PosMouse or ClampMouse).
  34. o    Enter all mouse routines (except ServeMouse) with the X register 
  35.      set to $Cn and Y register set to $n0, where n = the slot number.
  36. o    Some programs need to disable interrupts for purposes other than 
  37.      reading the mouse.  If interrupts are disabled then re-enabled, 
  38.      the first call to ReadMouse could return incorrect values; 
  39.      subsequent calls to ReadMouse will return correct values until 
  40.      interrupts are disabled and re-enabled again.  Disabling 
  41.      interrupts for mouse calls does not create this problem.  If you 
  42.      watch numbers from the mouse while moving it in a direction which 
  43.      would increase values, you would see something similar to: 6, 7, 
  44.      8, 9, 8, 9, 10.  In practice, this momentary "glitch" in the 
  45.      stream of data has little importance.  If you feel you must avoid 
  46.      this glitch altogether, do not disable interrupts for more than 40 
  47.      microseconds or make sure that at least one mouse interrupt takes 
  48.      place after re-enabling interrupts.
  49.  
  50.  
  51.  
  52.